package com.ice.day726.thread;

/**
 * @Author ice2020x
 * @Date 2022-07-27 12:34
 * @Description: 测试一下线程状态的改变
 */
public class ThreadTest4 {

    public static void main(String[] args) {

        Thread t = new Thread(() -> {
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        t.start();
        System.out.println("线程t的状态"+t.getState());

        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("线程t的状态"+t.getState());

    }
}
